/*
 * @Author: ckk
 * @Date: 2022-08-18 13:10:35
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2023-07-20 19:44:56
 * @Description: your project
 * @version: 1.0
 */
// 6896143922378728177 生产
// 6954506566493741733 测试
import axios from './request';
 /**
  * @author: ckk
  * @description: 获取版本号
  * @return {*}
  */
 export async function getVersion () {
  const productCode = localStorage.getItem('productCode'),
    { data } = await axios.get(`/apptemplate/${productCode}/version.json?version=${new Date().getTime()}`);
  return (data || {});
}
/**
 * @description: 获取所有装修的路径信息
 * @param {*} params 是否为特殊定制的页面
 * @Author: ckk
 * @Date: 2022-08-22 14:56:21
 * @return {*}
 */
export async function getMain (params) {
  const productCode = localStorage.getItem('productCode'),
    { data } = await axios.get(`/apptemplate/${productCode}/${params.mainType}/main_${params.mainId}.json`);
  return (data || {});
}
/**
 * @description: 获取局部装修json
 * @param {*} params //部分组件的路径
 * @Author: ckk
 * @Date: 2022-08-22 14:57:01
 * @return {*}
 */
export async function getPart (params, templateType) {
  if (params === '') {
    return '';
  }
  console.log(localStorage.getItem('productCode'), 'pppp');
  const productCode = localStorage.getItem('productCode'),
    { data } = await axios.get(`/apptemplate/${productCode}/${templateType}/${params}`);
  return (data || {});
}
/**
 * @description: 获取轮播数据
 * @param {*} params
 * @Author: ckk
 * @Date: 2022-08-24 10:02:01
 * @return {*}
 */
export async function getSwiperList (params) {
  const { data } = await axios.post(
    '/gw/nbocapi/nboc_outer/v1/outer/auth/ad_location',
    { ...params }
  );
  return (data || {});
}
/**
 * @description: 获取轮播详细信息
 * @param {*} params
 * @Author: ckk
 * @Date: 2022-08-31 10:04:45
 * @return {*}
 */
export async function getSwiperInfo (params) {
  const { data } = await axios.get(`/operation/nboc/ad/${params.name}.json`);
  return (data || {});
}
/**
 * @description: 获取用户的基本信息
 * @param {*} params
 * @Author: ckk
 * @Date: 2022-08-26 15:45:27
 * @return {*}
 */
export async function getStudentCode (params) {
  const { data } = await axios.get(
    '/gw/ucsapi/isch-c/v1/user/stage/grade/choice',
    { ...params }
  );
  console.log(data, 'ooop');
  return (data || {});
}
/**
 * @description: 修改用户基本信息
 * @param {*} params
 * @Author: ckk
 * @Date: 2022-08-30 09:45:55
 * @return {*}
 */
export async function setStudentCode (params) {
  const { data } = await axios.post(
    '/gw/ucsapi/isch-c/v1/user/stage/grade/choice',
    { ...params }
  );
  return (data || {});
}
